
//
//
//	NadineOSInterface
//
//
//

#define NDOS \
	(dynamic_cast<NDOSInterface*>(getArk()->queryModule("NDOSInterface", this)))

namespace Nadine{
	class NDOSInterface :public NDBaseObject
	{
	private:
	protected:

		//windows states
		bool m_bIsFullScreen;
		bool m_bWindowOnFocus;

		int  m_nWindowWidth;
		int  m_nWindowHeight;
		int  m_nWindowXPosi;   //WindowSpace Coordinate (left-botton is original point)
		int  m_nWindowYPosi;   //WindowSpace coordinate
		bool m_bMinimize;
		bool m_bMaximize;

		int  m_nMousePtX;
		int  m_nMousePtY;

		bool m_bWindowEnvInitialized;
		bool m_bRenderEnvInitialized;
		int	 m_nRenderEnv; //0:opengl, 1:directx, -1:uninitialize

		//interrput state
		bool m_bPauseRendering;
		bool m_bPauseClock;

		bool m_bForceLeave;


	public:
		NDOSInterface() :NDBaseObject(0),
		m_bIsFullScreen(false),
		m_bWindowOnFocus(true),
		m_bMinimize(false),
		m_bMaximize(false),
		m_bWindowEnvInitialized(false),
		m_bRenderEnvInitialized(false),
		m_nRenderEnv(-1),
		m_bPauseRendering(false),
		m_bForceLeave(false),
		m_bPauseClock(false)								{}
		virtual ~NDOSInterface()							{}

		//setup
		virtual void setWindowSize(int nWidth, int nHeight) =0;

		virtual bool initWindowEnv()						=0;
		virtual void destroyWindowEnv()						=0;

		//etc. window function
		virtual void setFullScreen(bool bFullScreen, int nWidth, int nHeight) =0;
		virtual void setShowWindow()						=0;
		virtual void setHideWindow()						=0;

		virtual void useGLContext( UINT nNo )				=0;
		virtual void useNULLGLContext()						=0;

		//fetch window state
		virtual int		getWindowWidth()  {return m_nWindowWidth;}
		virtual int		getWindowHeight() {return m_nWindowHeight;}

		//cgfx
		virtual void*	getCGcontext()	  {return 0;}

		virtual bool isGLExtensionSupported(const char* pStrExtension) {return false;}

		//Process Callback
		virtual void activeWindow()				=0;
		virtual long __stdcall wndProcBridge()	{return 0;}
		virtual long wndProc()					{return 0;}

		virtual void	forceLeave()			=0;

	};

}